using FireStarterModeller.BO;

namespace FireStarterModeller.Logic.Commands
{
    public interface ICommandFactory
    {
        ICommand CreateCreateAssembly(DMSolution solution, string assemblyName);
        ICommand CreateDeleteAssembly(DMAssembly assembly);
        ICommand CreateRenameAssembly(DMAssembly assembly, string newAssemblyName);

        ICommand CreateCreateClass(DMAssembly assembly, string className);
        ICommand CreateDeleteClass(DMClass dmClass);
        ICommand CreateRenameClass(DMClass dmClass, string newClassName);
    }

    public class CommandFactory : ICommandFactory
    {
        public ICommand CreateCreateAssembly(DMSolution solution, string assemblyName)
        {
            return new CreateAssemblyCommand(solution, assemblyName);
        }

        public ICommand CreateDeleteAssembly(DMAssembly assembly)
        {
            return new DeleteAssemblyCommand(assembly);
        }

        public ICommand CreateRenameAssembly(DMAssembly assembly, string newAssemblyName)
        {
            return new RenameAssemblyCommand(assembly, newAssemblyName);
        }

        public ICommand CreateCreateClass(DMAssembly assembly, string className)
        {
            return new CreateClassCommand(assembly, className);
        }

        public ICommand CreateDeleteClass(DMClass dmClass)
        {
            return new DeleteClassCommand(dmClass);
        }

        public ICommand CreateRenameClass(DMClass dmClass, string newClassName)
        {
            return new RenameClassCommand(dmClass, newClassName);
        }
    }
}